int search_table(string name) {
  for(int i=0;i<(int)table.size();i++)
    if(table[i]->name==name) return i;
  return -1;
}

int search_fd(string name) {
  for(int i=0;i<(int)fd.size();i++)
    if(fd[i]->name==name) return i;
  return -1;
}

int search_plotter(string name) {
  for(int i=0;i<(int)plotter.size();i++)
    if(plotter[i]->name==name) return i;
  return -1;
}

int search_buffer(string bufname) {
  for(int i=0;i<(int)buffer.size();i++) {
    if(buffer[i]->name==bufname) return i;
  }
  return -1;
}

int search_macro(string mname) {
  for(int i=0;i<(int)macname.size();i++) {
    if(macname[i]==mname) return i;
  }
  return -1;
}